Copyright: Sebastian Modersohn Softwaredevelopment


Contents of the The Clip Controls
The Clip Controls

This is a shareware product. This allows you to try the software before you buy it. If after evaluating The Clip Controls, you decide to continue using it, you are required to register the software by remitting the registration fee of $10 to us.

See How to register for information on registering The Clip Controls.

The Clip Controls consists of 8 units that descend objects of all kinds of windows to use the clip controls. Included are two descendants of tDialogWindow, an object of JanusW for using dialogs as MDI-Childs.

Object	Unit

tCCWindow	WndClip

tCCMDIWindow	MDIClip

tCCMDIChildWindow	MDICClip

tCCDialog	DlgClip

tCCDlgWindow	DlgWClip

tCCDialogWindow	JanClip

tCCMDICDialogWindow	JanCClip

All window-objects have the same routines to manage the clips.

See also:

How to install.

How to register.

Other products.


Clip Controls
Clip controls are these tiny buttons in the caption bar, used to maximize, restore or minimize a window.


Tips
Tips are these tiny yellow text windows that are shown if the user has moved the cursor to a clip for a while.


Sticky
Sticky because the clip stays down after it was pressed. If it is pressed a second time it is set up again (if it has several states the state changes then).


JanusW-Tool
JanusW-Tool (tDialogWindow)

JanusW is a tool of Peter Sawatzki which he created for using Dialogs as MDI-Childs. Therefore an tWindow descendant called tDialogWindow was built which can be used for normal dialogs too.

The file dialogwn.pas (Version 1.32) will be included in the registered version (with permission), but you can download the whole JanusW in CompuServe in the BPASCAL forum, Library OWL/BWCC[8], file JANUSW.ZIP.


tCCWindow
tCCWindow (Unit WndClip)

This tWindow-descendant is designed for using The Clip Controls in a normal tWindow. This object should be the ancestor of your own tWindow-descendants.

Do not use this object for MDI-Childs, because it would not display the clips in the menu if it is maximized such as Windows does it with the standard clips.

Use the object tCCMDIChildWindow instead.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCMDIWindow
tCCMDIWindow (Unit MDIClip)

This tMDIWindow-descendant is designed for using The Clip Controls in a MDI-Parentwindow. This object should be the ancestor of your own tMDIWindow-descendants.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCMDIChildWindow
tCCMDIChildWindow (Unit MDICClip)

This tWindow-descendant is designed for using The Clip Controls in a MDI-child-window. This object should be the ancestor of your own MDI-child-descendants.

This "extra" object is necessary because the clips of the child have to be displayed in the menu if it is maximized. Unfortunately the tips of the clips can't be displayed while they are in the menu.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCDialog
tCCDialog (Unit DlgClip)

This tDialog-descendant is designed for using The Clip Controls in a normal Dialog. This object should be the ancestor of your own tDialog-descendants.

If you want to use the Ctl3D-outfit for your dialogs you should use the tCCDialogWindow instead because the clips have to look a little bit different and the tDialogWindow does all the management of Ctl3D for you.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCDlgWindow
tCCDlgWindow (Unit DlgWClip)

This tDlgWindow-descendant is designed for using The Clip Controls in a tDlgWindow. This object should be the ancestor of your own tDlgWindow-descendants.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCDialogWindow
tCCDialogWindow (Unit JanClip)

This tDialogWindow-descendant is designed for using The Clip Controls in a tDialogWindow. This object should be the ancestor of your own tDialogWindow -descendants.

This object should be  used for dialogs with Ctl3D-outfit because the clips have to look a little bit different with Ctl3D and the tDialogWindow does all the management of Ctl3D.

If you use Ctl3D, the standard clips for maximizing and minimizing a dialog are not painted at the right postion if they were pressed. This is not a bug of The Clip Controls, its a bug of Ctl3D!

With this object you could fix this bug yourself: Create a normal Clip for ws_MinizeBox and a 2-State-Clip for ws_MaximizeBox. Then you can use tips for the standard clips (that is normally impossible) and the clips stay at the right position if they were pressed.

See also:

Routines to manage the clips

Overview of The Clip Controls


tCCMDICDialogWindow
tCCMDICDialogWindow (Unit JanCClip)

This tDialogWindow-descendant is designed for using The Clip Controls in a tDialogWindow which is used as a MDI-Child. This object should be the ancestor of your own tDialogWindow-descendants.

This "extra" object is necessary because the clips of the MDI-Child have to be displayed in the menu if it is maximized. Unfortunately the tips of the clips can't be displayed while they are in the menu.

See also:

Routines to manage the clips

Overview of The Clip Controls


Routines to manage the clips

Every window-object of The Clip Controls has the following methods to manage the clips of a window:

Method	    Description

AddClip	    Adds a normal clip to the window which is not sticky and which has one state.

AddClipEx	    Adds a clip to the window. All kinds of clips are possible.

AddStateClip	    Adds a clip with several states to the window which is not sticky.

AddStickyClip	    Adds a sticky clip to the window which has one state.

AddStickyStateClip	    Adds a clip to the window which is sticky and which has several states.

EnableClip	    Enables or disables a clip.

GetClipById	    Returns the index of the a clip searching by the ID.

GetClipState	    Returns the current state of a clip.

IsDisable	    Asks if a clip is currently disable.

IsDown	    Asks if a sticky clip is currently down.

SetClipDown	    Sets a sticky clip up or down.

SetClipState	    Sets the state of a clip which has several states.

SetClipText	    Sets the text for the tip of a clip.

See also:

Overview of The Clip Controls


AddClip
AddClip (Method)

Syntax:

function AddClip(aName: PChar; aId: Word; bDisabling: Boolean): Bool;

Description:

Adds a normal clip to the window which is not sticky and which has one state.

aName is the name of the bitmap(s) in the resource file. For every state a bitmap has to be used, if the clip should be disabled 2 bitmaps per state are necessary. If aName is "bitmap" the following bitmaps will be loaded: "bitmap_1" for the first state (enabled), "bitmap_d1" for the first state (disabled), "bitmap_2", "bitmap_d2" and so on.

The method does not check if the bitmaps does really exist! If a bitmap doesn't exist only the frame of the clip will be drawn and if running in debug mode some error message will occur.

aId is the ID of the clip. If it was pressed a wm_Command message with that ID will be sent to the window. The lParamLo of the message will be NULL, the lParamHi will be 2 (for distinguish between menu-, control- an clip-messages). For reacting on a press you can react also in the normal way by adding a message-response-procedure with virtual cm_first + cm_ID.

The tip-text of the clip will be the string-resource with that ID. You can set a different text by calling SetClipText.

The method does not check if a clip with that ID already exists! If a second clip with the same ID is added GetClipByID will return the index of the first clip added with that ID.

bDisabling is a flag for disabling-support of the clip.

Returns:

The return value is True if the clip was added, it is False if the clip could not be added because there wasn't enough space in the bitmap-array. You can change the size of this bitmap array for every unit by changing the MaxBMPS constant which is normally 20.

Comments:

This method calls AddClipEx with some standard parameters.

See also:

Routines to manage the clips

Overview of The Clip Controls


AddClipEx
AddClipEx (Method)

Syntax:

function AddClipEx(aName: PChar; aId: Word; NrOfStates: Byte; IsSticky, bDisabling: Boolean): Bool;

Description:

Adds a clip to the window. All kinds of clips are possible.

aName is the name of the bitmap(s) in the resource file. For every state a bitmap has to be used, if the clip should be disabled 2 bitmaps per state are necessary. If aName is "bitmap" the following bitmaps will be loaded: "bitmap_1" for the first state (enabled), "bitmap_d1" for the first state (disabled), "bitmap_2", "bitmap_d2" and so on.

The method does not check if the bitmaps does really exist! If a bitmap doesn't exist only the frame of the clip will be drawn and if running in debug mode some error message will occur.

aId is the ID of the clip. If it was pressed a wm_Command message with that ID will be sent to the window. The lParamLo of the message will be NULL, the lParamHi will be 2 (for distinguish between menu-, control- an clip-messages). For reacting on a press you can react also in the normal way by adding a message-response-procedure with virtual cm_first + cm_ID.

The tip-text of the clip will be the string-resource with that ID. You can set a different text by calling SetClipText.

The method does not check if a clip with that ID already exists! If a second clip with the same ID is added GetClipByID will return the index of the first clip added with that ID.

NrOfStates is the number of states the clip has. Minimum is 1, the maximum depends on the space in the bitmap-array and the MaxBMPS constant in every unit. Use GetClipState to get the current state of a clip.

IsSticky is a flag for the behaviour of the clip. If it is True the clip will be sticky.

bDisabling is a flag for disabling-support of the clip.

Returns:

The return value is True if the clip was added, it is False if the clip could not be added because there wasn't enough space in the bitmap-array. You can change the size of this bitmap array for every unit by changing the MaxBMPS constant which is normally 20.

See also:

Routines to manage the clips

Overview of The Clip Controls


AddStateClip
AddStateClip (Method)

Syntax:

function AddStateClip(aName: PChar; aId: Word; NrOfStates: Byte; bDisabling: Boolean): Bool;

Description:

Adds a clip with several states to the window which is not sticky.

aName is the name of the bitmap(s) in the resource file. For every state a bitmap has to be used, if the clip should be disabled 2 bitmaps per state are necessary. If aName is "bitmap" the following bitmaps will be loaded: "bitmap_1" for the first state (enabled), "bitmap_d1" for the first state (disabled), "bitmap_2", "bitmap_d2" and so on.

The method does not check if the bitmaps does really exist! If a bitmap doesn't exist only the frame of the clip will be drawn and if running in debug mode some error message will occur.

aId is the ID of the clip. If it was pressed a wm_Command message with that ID will be sent to the window. The lParamLo of the message will be NULL, the lParamHi will be 2 (for distinguish between menu-, control- an clip-messages). For reacting on a press you can react also in the normal way by adding a message-response-procedure with virtual cm_first + cm_ID.

The tip-text of the clip will be the string-resource with that ID. You can set a different text by calling SetClipText.

The method does not check if a clip with that ID already exists! If a second clip with the same ID is added GetClipByID will return the index of the first clip added with that ID.

NrOfStates is the number of states the clip has. Minimum is 1, the maximum depends on the space in the bitmap-array and the MaxBMPS constant in every unit. Use GetClipState to get the current state of a clip.

bDisabling is a flag for disabling-support of the clip.

Returns:

The return value is True if the clip was added, it is False if the clip could not be added because there wasn't enough space in the bitmap-array. You can change the size of this bitmap array for every unit by changing the MaxBMPS constant which is normally 20.

Comments:

This method calls AddClipEx with some standard parameters.

See also:

Routines to manage the clips

Overview of The Clip Controls


AddStickyClip
AddStickyClip (Method)

Syntax:

function AddStickyClip(aName: PChar; aId: Word; bDisabling: Boolean): Bool;

Description:

Adds a sticky clip to the window which has one state.

aName is the name of the bitmap(s) in the resource file. For every state a bitmap has to be used, if the clip should be disabled 2 bitmaps per state are necessary. If aName is "bitmap" the following bitmaps will be loaded: "bitmap_1" for the first state (enabled), "bitmap_d1" for the first state (disabled), "bitmap_2", "bitmap_d2" and so on.

The method does not check if the bitmaps does really exist! If a bitmap doesn't exist only the frame of the clip will be drawn and if running in debug mode some error message will occur.

aId is the ID of the clip. If it was pressed a wm_Command message with that ID will be sent to the window. The lParamLo of the message will be NULL, the lParamHi will be 2 (for distinguish between menu-, control- an clip-messages). For reacting on a press you can react also in the normal way by adding a message-response-procedure with virtual cm_first + cm_ID.

The tip-text of the clip will be the string-resource with that ID. You can set a different text by calling SetClipText.

The method does not check if a clip with that ID already exists! If a second clip with the same ID is added GetClipByID will return the index of the first clip added with that ID.

bDisabling is a flag for disabling-support of the clip.

Returns:

The return value is True if the clip was added, it is False if the clip could not be added because there wasn't enough space in the bitmap-array. You can change the size of this bitmap array for every unit by changing the MaxBMPS constant which is normally 20.

Comments:

This method calls AddClipEx with some standard parameters.

See also:

Routines to manage the clips

Overview of The Clip Controls


AddStickyStateClip
AddStickyStateClip (Method)

Syntax:

function AddStickyStateClip(aName: PChar; aId: Word; NrOfStates: Byte; bDisabling: Boolean): Bool;

Description:

Adds a clip to the window which is sticky and which has several states.

aName is the name of the bitmap(s) in the resource file. For every state a bitmap has to be used, if the clip should be disabled 2 bitmaps per state are necessary. If aName is "bitmap" the following bitmaps will be loaded: "bitmap_1" for the first state (enabled), "bitmap_d1" for the first state (disabled), "bitmap_2", "bitmap_d2" and so on.

The method does not check if the bitmaps does really exist! If a bitmap doesn't exist only the frame of the clip will be drawn and if running in debug mode some error message will occur.

aId is the ID of the clip. If it was pressed a wm_Command message with that ID will be sent to the window. The lParamLo of the message will be NULL, the lParamHi will be 2 (for distinguish between menu-, control- an clip-messages). For reacting on a press you can react also in the normal way by adding a message-response-procedure with virtual cm_first + cm_ID.

The tip-text of the clip will be the string-resource with that ID. You can set a different text by calling SetClipText.

The method does not check if a clip with that ID already exists! If a second clip with the same ID is added GetClipByID will return the index of the first clip added with that ID.

NrOfStates is the number of states the clip has. Minimum is 1, the maximum depends on the space in the bitmap-array and the MaxBMPS constant in every unit. Use GetClipState to get the current state of a clip.

bDisabling is a flag for disabling-support of the clip.

Returns:

The return value is True if the clip was added, it is False if the clip could not be added because there wasn't enough space in the bitmap-array. You can change the size of this bitmap array for every unit by changing the MaxBMPS constant which is normally 20.

Comments:

This method calls AddClipEx with some standard parameters.

See also:

Routines to manage the clips

Overview of The Clip Controls


EnableClip
EnableClip (Method)

Syntax:

function EnableClip(aIndex: Byte; aEnable: Bool): Bool;

Description:

Enables or disables a clip.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

bDisabling is a flag for enabling/disabling the clip.

Returns:

The return value is True if the clip's style was changed succesfully, it is False if aIndex is not a valid clip, if the clip was already enabled/disabled or if the clip does not support disabling.

See also:

Routines to manage the clips

Overview of The Clip Controls


GetClipById
GetClipById (Method)

Syntax:

function GetClipById(aId: Word): Byte;

Description:

Returns the index of the first clip which has this ID.

aID is the ID of the clip which is searched. If more than one clip with that ID exists, the index of the first clip is returned.

Returns:

The return value is the index of the clip or NULL if no clip was found.

See also:

Routines to manage the clips

Overview of The Clip Controls


GetClipState
GetClipState (Method)

Syntax:

function GetClipState(aIndex: Byte): Byte;

Description:

Returns the current state of a clip.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

Returns:

The return value is the current state of the clip (1-based) or NULL if the clip wasn't found.

See also:

Routines to manage the clips

Overview of The Clip Controls


IsDisable
IsDisable (Method)

Syntax:

function IsDisable(aIndex: Byte): Bool;

Description:

Asks if a clip is currently disable.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

Returns:

The return value is True if the clip is currently disabled it is False if aIndex is not a valid clip, or f it is enabled.

See also:

EnableClip

Routines to manage the clips

Overview of The Clip Controls


IsDown
IsDown (Method)

Syntax:

function IsDown(aIndex: Byte): Bool;

Description:

Asks if a sticky clip is currently down.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

Returns:

The return value is True if the clip is currently down, it is False if aIndex is not a valid clip, if the clip is not down or if it isn't sticky.

See also:

Routines to manage the clips

Overview of The Clip Controls


SetClipDown
SetClipDown (Method)

Syntax:

function SetClipDown(aIndex: Byte; Down: Boolean): Bool;

Description:

Sets a sticky clip up or down.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

Down is a flag for setting the clip up or down. If it is True the clip will be set down else it will be set up

Returns:

The return value is True if the clip's style was changed succesfully, it is False if aIndex is not a valid clip, if the clip was already up/down or if the clip isn't sticky.

See also:

Routines to manage the clips

Overview of The Clip Controls


SetClipState
SetClipState (Method)

Syntax:

function SetClipState(aIndex, aState: Byte): Bool;

Description:

Sets the state of a clip which has several states.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

aState is the is the state (1-based) the clip should get.

Returns:

The return value is True if the clip's style was changed succesfully, it is False if aIndex is not a valid clip, or the clip supports not so much states or the state was already set.

See also:

Routines to manage the clips

Overview of The Clip Controls


SetClipText
SetClipText (Method)

Syntax:

procedure SetClipText(aIndex: Byte; aText: PChar);

Description:

Sets the text for the tip of a clip.

aIndex is the index of the clip. Use GetClipById to get the index of a clip by the ID.

aText is the new text of the clip. It should be not longer than 255 chars.

Comments:

Normally the text of a tip is the string-resource with the ID of the clip. If you do not use these strings there will be some error-messages in debug-mode if the LoadString-function fails.

See also:

Routines to manage the clips

Overview of The Clip Controls


How to install

You can copy the files of The Clip Controls in every directory you want.

Make sure that the IDE will find the units (*.TPW-files). You can do that by adding the directory of The Clip Controls to the unit directory via the menu Options, item Directories... .

See the BP help for more information about units.


How to register

The Clip Controls were created by:

Sebastian Modersohn Softwaredevelopment Heinestrasse 20 D 15370 Petershagen, Germany Phone: +49 33439 7462 CompuServe ID: 100340,1474

This is a shareware product. This allows you to try the software before you buy it. If after evaluating The Clip Controls, you decide to continue using it, you are required to register the software by remitting the registration fee of $10 to us.

To register "GO SWREG" inside CompuServe and register The Clip Controls with the database ID 4195.

After CompuServe has send us your User ID we will send the registered version via E-Mail to you as quickly as possible.


Other products

Also available from

Sebastian Modersohn Softwaredevelopment Heinestrasse 20 D 15370 Petershagen, Germany Phone: +49 33439 7462 CompuServe ID: 100340,1474
are the following products:

Name	Description

SMWCC	A custom control pack which consists of four custom controls which can be used with the Resource Workshop.
-a PercentBar with optional 3D frame
-a MicroScroll for dec/inc values of an edit control (units and partially disabling supported)
-a MenuButton: Mac-like button which displays a menu if it was pressed
-a "Structo" control: to draw inside a dialog, using the GDI (scrolling supported)
The unregistered version is available via CompuServe, forum BPASCAL, library Windows Tools[10], file SMWCC.ZIP. You can register SMWCC for $15.00 in the forum SWREG. The database ID of SMWCC is 3742.